# coding: utf8


class TestProperty:

    def __init__(self, score):
        self.score = score

    @property
    def score(self):
        return self.__score

    @score.setter
    def score(self, val):
        if val >= 0:
            self.__score = val
        else:
            raise ValueError('improper value {}!'.format(val))


def test_property():
    t = TestProperty(100)
    print(t.score)
    t.score = 80
    try:
        t.score = -60
    except ValueError as e:
        print('Error: {}'.format(e))
    else:
        print('Other Error')
